<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="/springboot/js/jquery-3.5.1.js"></script>
    <script src="/springboot/js/crypto-js.js"></script>
    <script>
        var sendLROARequest = function(){
            debugger
            var userid = encrypt('a997a25dbb6a4f5aa65cc87637a09e23');
            var user= {userid: userid};
            var url = "http://192.168.5.210:8090/LROA/restservices/LROA/lroa_searcHumanLroadala/query";
            $.ajax({
                type: "post",
                async: false,//同步，异步
                url: url, //请求的服务端地址
                data: {par: user},
                dataType: "json",
                success:function(data){
                    console.log(data);
                },
                error:function(i, s, e){
                    flag = false;
                    alert('error'); //错误的处理
                }
            });
        }

        //加密方法
        function encrypt(data) {
            var key = CryptoJS.enc.Utf8.parse(_h5ensid);
            var iv = CryptoJS.enc.Utf8.parse(_h5ensid);
            return CryptoJS.AES.encrypt(data, key, {
                iv: iv,
                mode: CryptoJS.mode.CBC
            }).toString();
        }
    </script>
</head>
<body>
    <tr>
        <input type="button" onclick="sendLROARequest()" value="加密测试"/>
    </tr>
</body>
</html>